#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int areaOfMaxDiagonal(vector<vector<int>>& dimensions) {
    sort(dimensions.begin(), dimensions.end());
    int ma = 0, res = 0;
    for (auto v : dimensions)
    {
        int len = v[0] * v[0] + v[1] * v[1];
        if (len > ma)
        {
            res = v[0] * v[1];
            ma = len;
        }
        else if (len == ma)
            res = max(res, v[0] * v[1]);
    }
    return res;
}

int main()
{
	return 0;
}